import page from "../views";
import ddd from '../views/TableDemo/index.vue'
const rooter = [
  {
    //将匹配的所有内容并将其放在$router.params.pathmatch下
    path: "/:pathMatch(.*)*",
    name: "NotFound",
    noShowMenu: true,
    component: page.Nofind,
  },
  {
    path: "/login",
    name: "login",
    component: page.Login,
    noShowMenu: true,
  },
  {
    path: "/home",
    name: "home",
    alias: ["/",''], //别名--可以是一个字符串或者数组形式
    component: page.HomeView,
  },
  {
    path: "/projecDemo",
    name: "projecDemo",
    component: page.projecDemo,
  },
  {
    path: "/about",
    name: "vue2的初始练习",
    component: page.Aboutpage,
  },
  {
    path: "/propsDemo",
    name: "组件传参练习",
    component: page.PropsDemo,
    mata: { required: true }, //路由元信息
  },
  {
    path: "/showDemo",
    name: "异步加载组件",
    component: page.ShowDemo,
    beforeEnter: (to, from) => {
      //路由守卫
      // return false
    },
  },

  {
    path: "/moveRouter/:id",
    name: "v-router练习",
    component: page.RouterDemo,
    props: true,
  },
  // project-demo
  {
    //嵌套路由
    path: "/cardemo",
    // redirect:'/showDemo2/showone', //重定向
    name: "cardemo",
    children: [
      {
        path: "projectdemo",
        name: "projectdemo",
        component: page.Projectdemo,
      },
      {
        path: "projectdemo-detail",
        name: "projectdemo-detail",
        noShowMenu: true,
        component: page.ProjectDetail,
      },
      {
        path: "facedemo",
        name: "facedemo",
        component: page.FaceDemo,
      },
      {
        path: "faceResult",
        name: "faceResult",
        noShowMenu: true,
        component: page.FaceResult,
      },
      {
        path: "telpDemo",
        name: "telpDemo",
        component: page.TelpDemo,
      },
    ],
  },

  {
    path: "/vue2demo",
    name: "vue2demo",
    component: page.vue2demo,
  },
  {
    path: "/formGenerator",
    name: "formGenerator",
    component: page.formPage,
  },
  {
    path: "/tabledemo",
    name: "表格展示",
    children: [
      {
        path: "/table",
        name: "vue3示例",
        component: ddd,
      },
      {
        path: "/table2",
        name: "vue2示例",
        component: page.TableDemo2,
      },
    ],
  },

  {
    path: "/someJS",
    name: "someJS",
    component: page.someJS,
  },
];

export default rooter;
